<script>
import xss from 'xss'

export default {
  functional: true,
  props: {
    recordData: {
      type: Object,
      default: () => ({}),
    },
  },
  render: (h, ctx) => {
    const { recordData } = ctx.props
    return h('div', { class: 'p-2' }, [
      h('div', {
        class: 'text-left record-option',
        domProps: {
          innerHTML: xss(recordData.approval_option || ''),
        },
      }),
      h('div', { class: 'd-flex justify-content-between' }, [
        h('span', [
          h('span', `签字：${recordData.approval_person || ''}`),
          h(
            'span',
            { style: { color: 'red' } },
            `${
              +recordData.approval_status === 3
                ? ' (退回)'
                : +recordData.approval_status === 2
                ? '(拒绝)'
                : ''
            }`
          ),
        ]),
        h('span', `日期：${recordData.dateStr || ''}`),
      ]),
    ])
  },
}
</script>
